package me.ywd.consumer.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author Ye_Wenda
 * @Date 8/8/2017
 */
@RestController
@RequestMapping("/consumer/ribbon")
public class ConsumerRibbonDemoController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping()
    public String getConsumer() {
        return restTemplate.getForObject("http://provider/services", String.class);
    }
}
